export default function userReducer(state={user:{id:1,name:"xiaowang"}},action){
    switch(action.type){
        case "updateUsername":
            state.user.name = action.payload;
            return state
        case "initUser":
            state.user = action.payload
            return state
        default:
            return state
        
    }
}